import SwiftUI
import SwiftyJSON

struct HomeView: View {
    @State var isLoginShow = false
    @State var isLoaded = false
    var body: some View {
        Form {
            Section(header: Text("工作台")) {
                HomeListItem(
                    title: "代码仓库",
                    icon: "archivebox.circle",
                    color: Color.red
                )

                HomeListItem(
                    title: "Issues",
                    icon: "exclamationmark.circle",
                    color: Color.red
                )
            }
        }
    }
}

struct HomeListItem: View {
    @State var title: String
    @State var icon: String
    @State var color: Color

    var body: some View {
        HStack(spacing: 15) {
            Image(systemName: icon)
                .scaleEffect(1.5, anchor: .center)
                .foregroundColor(color)
            Text(title).font(.system(size: 16))
        }
        .padding(.horizontal, 5)
        .frame(height: 48)
        .cornerRadius(10)
    }
}

struct HomeTeamItem: View {
    @State var title: String
    var body: some View {
        Text(title).font(.system(size: 16))
            .frame(height: 48)
            .cornerRadius(10)
    }
}
